#include "HelloWorldMainWindow.h"
#include "ui_HelloWorldMainWindow.h"

HelloWorldMainWindow::HelloWorldMainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::HelloWorldMainWindow)
{
    ui->setupUi(this);

    /*
     * 将文字居中
     */
    ui->textLabel->setAlignment(Qt::AlignCenter);
    ui->wosayLabel->setAlignment(Qt::AlignCenter);

    /*
     * 将按钮的clicked信号与HelloWorldMainWindow类中的槽函数进行连接
     */
    connect(ui->helloPushButton, SIGNAL(clicked(bool)),
            this, SLOT(wosaySlot()));
}

HelloWorldMainWindow::~HelloWorldMainWindow()
{
    delete ui;
}

void HelloWorldMainWindow::wosaySlot()
{
    /*
     * 促发按钮事件，调用此槽函数
     */
    ui->wosayLabel->setText("world");
}
